package com.emc.esu.api.test
{
	import com.emc.esu.api.rest.EsuRestApi;
	import com.emc.esu.api.rest.EsuRestApiHttp;

	public class EsuApiTestHttp extends EsuApiTest
	{
		/**
		 * Set this to your test UID
		 */
		private static const UID:String = "085e680545e8497899ae72c449462b7f/A4034851835524929c3c";
		
		/**
		 * Set this to your test UID's shared secret
		 */
		private static const SECRET:String = "nFi9d2JxlUigkLChOXh6By5CJ9I=";
		
		/**
		 * Set this to your ESU access server's hostname or IP
		 */
		private static const HOST:String = "lciga077.lss.emc.com";

		/**
		 * Set to your ESU access server's port.  Usually 80 or 443.
		 */
		private static const PORT:int = 80;

		
		
		public function EsuApiTestHttp()
		{
			super();
		}
		
		
		/**
		 * Creates a new connection object for each test.
		 */		
		public override function setUp():void {
			cleanup = new Array();
			esu = new EsuRestApiHttp( HOST, PORT, UID, SECRET );
			//esu = new EsuRestApi( HOST, PORT, UID, SECRET );

		}
		
		/**
		 * Test handling signature failures.  Should throw an exception with
		 * error code 1032.
		 */
		public override function testSignatureFailure():void {
			// break the secret key
			var badSecret:String = SECRET.toUpperCase();
			this.esu = new EsuRestApiHttp( HOST, PORT, UID, badSecret );
			
			this.esu.createObject( null, null, null, null, addAsync( handleTestSignatureFailureResponse, TIMEOUT ), null );
		}


	}
}